<?php
// +---------------------------------------------------------------------+
// | OneBase    | [ WE CAN DO IT JUST THINK ]                            |
// +---------------------------------------------------------------------+
// | Licensed   | http://www.apache.org/licenses/LICENSE-2.0 )           |
// +---------------------------------------------------------------------+
// | Author     | Bigotry <3162875@qq.com>                               |
// +---------------------------------------------------------------------+
// | Repository | https://gitee.com/Bigotry/OneBase                      |
// +---------------------------------------------------------------------+

namespace app\admin\controller;

use app\common\model\ForumBbsCategory;
use app\common\model\ForumBbsLevel;
use app\common\model\GamblerKing;
use app\common\model\GamblerKingAction;
use app\common\model\KingCategory;

/**
 * 赌王控制器
 */
class Ranking extends AdminBase
{

    /**
     * 充值排行榜
     */
    public function recharge_rank()
    {

        // $where = $this->logicKing->getWhere($this->param);
        $this->param['type']=1;
        $this->assign('list', $this->logicRanking->getRecharge($this->param, 'a.*', 'a.create_time desc'));
        $this->assign('param', $this->param);
        $this->assign('url', url('recharge_rank'));
        return $this->fetch('recharge_rank');
    }

    /**
     * 盈利排行榜
     */
    public function profit_rank()
    {

        // $where = $this->logicKing->getWhere($this->param);
        $this->param['type']=2;
        $this->assign('list', $this->logicRanking->getRecharge($this->param, 'a.*', 'a.create_time desc'));
        $this->assign('param', $this->param);
        $this->assign('url', url('profit_rank'));
        return $this->fetch('recharge_rank');
    }

    /**
     * 充值排行榜编辑
     */
    public function recharge_rank_edit()
    {

        IS_POST && $this->jump($this->logicRanking->recharge_rank_edit($this->param,url('recharge_rank')));
        $this->assign('param', $this->param);
        return $this->fetch('recharge_rank_edit');
    }
    /**
     * 委托排行榜
     */
    public function entrust_rank()
    {

        // $where = $this->logicKing->getWhere($this->param);
        $this->param['type']=3;
        $this->assign('list', $this->logicRanking->getRecharge($this->param, 'a.*', 'a.create_time desc'));
        $this->assign('param', $this->param);
        $this->assign('url', url('entrust_rank'));
        return $this->fetch('recharge_rank');
    }
    /**
     * 提现排行榜
     */
    public function withdrawal_rank()
    {

        // $where = $this->logicKing->getWhere($this->param);
        $this->param['type']=4;
        $this->assign('list', $this->logicRanking->getRecharge($this->param, 'a.*', 'a.create_time desc'));
        $this->assign('param', $this->param);
        $this->assign('url', url('withdrawal_rank'));
        return $this->fetch('recharge_rank');
    }

    /**
     * 赌王盈利排行榜
     */
    public function king_profit_rank()
    {

        // $where = $this->logicKing->getWhere($this->param);
        $this->param['type']=5;
        $this->assign('list', $this->logicRanking->getKingRecharge($this->param, 'a.*', 'a.create_time desc'));
        $this->assign('param', $this->param);
        $this->assign('url', url('king_profit_rank'));
        return $this->fetch('king_rank');
    }

    /**
     * 赌王分红排行榜
     */
    public function king_bonus_rank()
    {

        // $where = $this->logicKing->getWhere($this->param);
        $this->param['type']=6;
        $this->assign('list', $this->logicRanking->getKingRecharge($this->param, 'a.*', 'a.create_time desc'));
        $this->assign('param', $this->param);
        $this->assign('url', url('king_bonus_rank'));
        return $this->fetch('king_rank');
    }

    /**
     * 赌王下注排行榜编辑
     */
    public function king_bets_rank()
    {
        // $where = $this->logicKing->getWhere($this->param);
        $this->param['type']=8;
        $this->assign('list', $this->logicRanking->getKingRecharge($this->param, 'a.*', 'a.create_time desc'));
        $this->assign('param', $this->param);
        $this->assign('url', url('king_bets_rank'));
        return $this->fetch('king_rank');
    }
    /**
     * 赌王委托排行榜
     */
    public function king_entrust_rank()
    {

        // $where = $this->logicKing->getWhere($this->param);
        $this->param['type']=9;
        $this->assign('list', $this->logicRanking->getKingRecharge($this->param, 'a.*', 'a.create_time desc'));
        $this->assign('param', $this->param);
        $this->assign('url', url('king_entrust_rank'));
        return $this->fetch('king_rank');
    }

    /**
     * 赌王信用分排行榜编辑
     */
    public function king_credit_rank()
    {


        // $where = $this->logicKing->getWhere($this->param);
        $this->param['type']=7;
        $this->assign('list', $this->logicRanking->getKingRecharge($this->param, 'a.*', 'a.create_time desc'));
        $this->assign('param', $this->param);
        $this->assign('url', url('king_credit_rank'));
        return $this->fetch('king_rank');
    }

    /**
     * 赌王排行榜编辑
     */
    public function king_rank_edit()
    {


        IS_POST && $this->jump($this->logicRanking->king_rank_edit($this->param,url('recharge_rank')));
        $this->assign('param', $this->param);
        return $this->fetch('king_rank_edit');
    }





}
